<script>
  // 清新配色
  // color: [
  //   '#00a8e1', '#99cc00', '#e30039', '#fcd300',
  //   '#800080', '#00994e', '#ff6600', '#808000',
  //   '#db00c2', '#008080', '#0000ff', '#c8cc00'
  // ],
  // 炫彩配色
  // color: [
  //   '#ef4464', '#fad259', '#d22e8d', '#03dee0',
  //   '#d05c7c', '#bb60b2', '#433e7c', '#f47a75',
  // eslint-disable-next-line no-irregular-whitespace
  //   '#009db2', '#024b51', '#0780cf', '#765005 ​​​​​​​'
  // ],
  // 渐变配色
  // color: [
  //   '#71ae46', '#96b744', '#c4cc38', '#ebe12a',
  //   '#eab026', '#e3852b', '#d85d2a', '#ce2626',
  //   '#ac2026', '#71ae46', '#96b744', '#c4cc38'
  // ],
  import EChart from '@comp/echart/EChart'

  export default {
    name: 'RosePieChart',
    extends: EChart,
    data() {
      return {
        option: {
          legend: {
            show: false
          },
          // 淡雅配色
          color: [
            '#95a2ff', '#fa8080', '#ffc076',
            '#87e885', '#3cb9fc', '#73abf5', '#cb9bff',
            '#f7a35c', '#8085e9'
          ],
          tooltip: { // 用于自定义悬浮内容
            color: '#fff',
            formatter: '{b}:{c}({d}%)'
          },
          series: [
            {
              type: 'pie',
              radius: [37, 180],
              center: ['50%', '50%'],
              roseType: 'area',
              itemStyle: {
                borderRadius: 2
              },
              label: {
                color: '#fff',
                position: 'inner',
                textStyle: {
                  fontWeight: 700,
                  fontSize: 14
                },
                formatter: '{b}\n{d}%'
              },
              data: []
            }
          ]
        }
      }
    },
    mounted() {
      this.initData()
    },
    methods: {
      setData(seriesData) {
        this.option.series[0].data = seriesData
        this.updateOption()
      }
    }
  }
</script>

<style lang="less" scoped>
</style>
